/*
 * Copyright (c) 2024 Huawei Technologies Co.,Ltd.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * -------------------------------------------------------------------------
 *
 * htap_modify.h
 * Interface for main HTAP hooks.
 *
 * IDENTIFICATION
 * src/include/storage/htap/htap_modify.h
 *
 * -------------------------------------------------------------------------
 */

#ifndef HTAP_MODIFY_H
#define HTAP_MODIFY_H

#include "storage/item/itemptr.h"
#include "executor/tuptable.h"
#include "nodes/parsenodes_common.h"
#include "utils/relcache.h"
#include <unordered_map>

extern void HTAPExecInsertRow(Oid relationId, ItemPointer ctid, TupleTableSlot *slot);

extern void HTAPExecUpdateRow(Oid relationId, ItemPointer oldCtid, ItemPointer newCtid, TupleTableSlot *slot);

extern void HTAPExecDeleteRow(Oid relationId, ItemPointer ctid);

extern void HTAPCreateTable(Oid parentId, Oid relationId);

extern void HTAPDropTable(Oid relationId, std::unordered_map<Oid, RelFileNode> **out_oid_del_info);

extern void HTAPTruncateTable(Oid relationId, std::unordered_map<Oid, RelFileNode> **out_oid_del_info);

extern void HTAPAlterTable(Oid relationId, Relation rel, AlterTableStmt *stmt);

extern void HTAPSearchDelta(Oid relationId, uint64_t &rowCount, uint64_t &visibleRowCount, uint64_t &memSize);

#endif // HTAP_MODIFY_H
